/**
 * 
 */
package com.swg.cocobox.message;

import com.swg.cocobox.message.internal.MessageBuilder;
import com.swg.cocobox.message.internal.MessageParser;

/**
 * @author satriaprayoga
 *
 */
public abstract class MessageFactory {

	private final MessageBuilder builder;
	private final MessageParser parser;
	
	public MessageFactory(MessageBuilder builder,MessageParser parser) {
		this.builder=builder;
		this.parser=parser;
	}
	
	public Message createPrivateMsg(String origin,String destination,String content){
		return builder.buildPrivate(origin, destination, content);
	}
	
	public Message createBroadcastMsg(String origin,String content){
		return builder.buildBroadcast(origin, content);
	}
	
	public Message parseMessage(byte[] data){
		return parser.parseMessage(data);
	}
}
